﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace TlToolCordCreate
{
    /// <summary>
    /// vvmPro.xaml 的交互逻辑
    /// </summary>
    public partial class vvmPro : UserControl
    {
        public vvmPro()
        {
            InitializeComponent();
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string code = "";
            code += "/// <summary>\r\n";
            code += $"/// {proName.Text}\r\n";
            code += $"/// </summary>\r\n";
            code += $"private string _{pro.Text.Trim()};\r\n";
            code += "/// <summary>\r\n";
            code += $"/// {proName.Text}\r\n";
            code += $"/// </summary>\r\n";
            code += "public string "+ pro.Text.Trim() + " { get => _" + pro.Text.Trim() + "; set => SetProperty(ref _"+ pro.Text.Trim() + ", value); }\r\n";
            procode.Text = code;
            code = "";
            code += "/// <summary>\r\n";
            code += $"/// {proName.Text}\r\n";
            code += $"/// </summary>\r\n";
            code += $"private string _{pro.Text.Trim()};\r\n";
            code += "/// <summary>\r\n";
            code += $"/// {proName.Text}\r\n";
            code += $"/// </summary>\r\n";
            code += "public string " + pro.Text.Trim() + " { get => _" + pro.Text.Trim() + "; set { _" + pro.Text.Trim() + " = value; OnPropertyChanged(); } }\r\n";
            procode2.Text = code;
        }
    }
}
